﻿using ARchGL.Platform.Authorization.Users;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace ARchGL.Platform.Core
{
    /// <summary>
    /// 用户与组织架构（部门）中间表扩展
    /// </summary>
    public class UserOrganizationUnitExtend : Abp.Authorization.Users.UserOrganizationUnit
    {
        public UserOrganizationUnitExtend() { }

        public UserOrganizationUnitExtend(int? tenantId, User user, OrganizationUnitExtend ou)
        {
            TenantId = tenantId;
            UserId = user.Id;
            UserPrimaryId = user.PrimaryId;
            OrganizationUnitId = ou.Id;
            OrganizationUnitPrimaryId = ou.PrimaryId;
        }

        /// <summary>
        /// 用户 GUID 标识
        /// </summary>
        public Guid UserPrimaryId { get; set; }
        /// <summary>
        /// 组织（公司） GUID 标识
        /// </summary>
        public Guid OrganizationUnitPrimaryId { get; set; }
        /// <summary>
        /// 自定义实体类名称（UserOrganizationUnitExtend）
        /// </summary>
        [MaxLength(26)]
        private string Discriminator { get { return "UserOrganizationUnitExtend"; } }
    }
}
